package edu.zut.cs.software.perfect.grade.domain;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import edu.zut.cs.software.perfect.base.domain.BaseTreeEntity;

/**
 * @ClassName CourseGrade
 * @Description TODO
 * @Author zhangwenkai
 * @Date 2020年5月29日 下午7:18:41
 * @Version 1.0
 */
@Entity
@Table(name = "T_COURSEGRADE")
@NamedQueries({ @NamedQuery(name = "CourseGrade.getRoot", query = "select m from CourseGrade m where m.parent is null") })
public class CourseGrade extends BaseTreeEntity<CourseGrade,Long> {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	/**
	 * courseName for CourseGrade
	 */
	@Column
	private String courseName;
	
	/**
	 * courseCode for CourseGrade
	 */
	@Column
	private String courseCode;
	
	@OneToMany(mappedBy = "courseGrade", cascade = CascadeType.REMOVE, fetch = FetchType.EAGER)
	List<StudentGrade> studentGrade;

	public String getCourseName() {
		return courseName;
	}

	public void setCourseName(String courseName) {
		this.courseName = courseName;
	}

	public String getCourseCode() {
		return courseCode;
	}

	public void setCourseCode(String courseCode) {
		this.courseCode = courseCode;
	}

	

}
